#include "statusnotifieritem.h"

#include <QDebug>
StatusNotifierItem::StatusNotifierItem(QObject *parent) : QObject(parent) {
    // 注册 DBus 服务
    QDBusConnection dbus = QDBusConnection::sessionBus();
    if (!dbus.registerService("org.kde.StatusNotifierWatcher")) {
        qWarning() << "DBus service registration failed:";
    }
    dbus.registerObject("/StatusNotifierItem", this, QDBusConnection::ExportAllSlots);
}

void StatusNotifierItem::Activate(int x, int y) {
    emit showWindowRequested();  // 自定义信号，触发主窗口显示
}

void StatusNotifierItem::ContextMenu(int x, int y) {
    // 显示右键菜单
}

void StatusNotifierItem::SecondaryActivate(int x, int y) {
    // 次级激活（如鼠标中键点击）
}
